feat: Add raycasting from players perspective.#786
feat: Add raycasting from players perspective.#786Saskyc wants to merge 6 commits intoExMod-Team:masterfrom
Conversation
Mr-Baguetter
left a comment
There was a problem hiding this comment.
Looks good to me.
I dont see any obvious issues.
…ad of "Player" as Yamato suggested
louis1706
left a comment
There was a problem hiding this comment.
i just would like to test GetRaycastedPlayer just in case but should be good
I will make branch in Exiled Test and attach link to the branch with video. |
say me when done |
michcio15
left a comment
There was a problem hiding this comment.
Could you also add trygetraycastplayer will notnullwhen true so its cleaner (personal preference)
And also add native usage of LayerMasks enum
| /// </summary> | ||
| /// <param name="maxDistance">The max distance the raycast can reach.</param> | ||
| /// <returns><see cref="Player"/> if any.</returns> | ||
| public Player GetRaycastedPlayer(float maxDistance) => |
There was a problem hiding this comment.
Exiled.API doesnt have nullable enabled iirc
There was a problem hiding this comment.
(the structs are nullable in this PR though because that represents a different type, Nullable<RaycastHit>, C# moment
)
… or anything in layer mask.
Description
Describe the changes
Adds new method to raycast from players CameraTransform.
Either for anything with layermask or for player & hitbox with predefined layermasks.
What is the current behavior? (You can also link to an open issue here)
What is the new behavior? (if this is a feature change)
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
None.
Other information:
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other